<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
</head>
<link href="../css/style1.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../js/jhs.js"></script>
<body>
<script type="text/javascript">
    function onChangeTag(menuid){
        var menu = document.getElementById("login_menu");
        var lis = menu.getElementsByTagName("li");
        var login_content = document.getElementById("login_content");
        var register_content = document.getElementById("register_content");
        if(menuid == 0){
            login_content.style.display = "";
            register_content.style.display = "none";
        }else{
            login_content.style.display = "none";
            register_content.style.display = "";
        }
        for(var i = 0;i < lis.length;i++){
            if(i==menuid){lis[i].setAttribute("class","active")}
            else{lis[i].setAttribute("class","")}
        }
    }

    function login(type){
        var username = '';
        var password = '';
        if(type==0){
            username = document.getElementById('un1').value;
            password = document.getElementById('pd1').value;
        }else{
            username = document.getElementById('un2').value;
            password = document.getElementById('pd2').value;
        }
        window.location.href='../behind_manage/login.php?type='+type+'&username='+username+'&password='+password;
    }

    function checkPwd(){
        var pd2 = document.getElementById('pd2').value;
        var rpd2 = document.getElementById('rpd2').value;
        if(pd2!==rpd2){
            document.getElementById('pd_alert').style.display = 'block';
        }else{
            document.getElementById('pd_alert').style.display = 'none';
        }
    }
</script>
<div id="login_page" class="login_page">
    <ui class="login_tags" id="login_menu">
        <li onclick="onChangeTag(0)" class="active">
            <div class="login_tag hover">登录</div>
        </li>
        <li onclick="onChangeTag(1)">
            <div class="login_tag">注册</div>
        </li>
    </ui>
    <div id="login_content" class="login_tag_contents">
        <div class="login_tag_content display_inline_block">
            <p>用户名:</p><input type="text" id="un1"><br>
            <p>密  码:</p><input type="password" style="height: 26px;" id="pd1"><br>
            <input type="button" onclick="javascript:window.open('jufuli.html','_self');" value="返回"> <input type="button" onclick="login(0)" value="登录">
        </div>
    </div>
    <div id="register_content" class="login_tag_contents" style="display: none;">
        <div class="login_tag_content display_inline_block">
            <p>用 户 名:</p><input type="text" id="un2"><br>
            <p>密    码:</p><input type="password" style="height: 26px;" id="pd2"><br>
            <p style="color: #b04343;font-size: 10px;display: none;text-align: center;margin: 0px auto;" id="pd_alert">密码不一致</p>
            <p>确认密码:</p><input type="password" style="height: 26px;" id="rpd2" onblur="checkPwd();"><br>
            <input type="button" value="返回" onclick="javascript:window.open('jufuli.html','_self');"> <input type="button" onclick="login(1)" value="注册">
        </div>
    </div>
</div>
</body>
</html>